1. Field of the Invention
The present invention relates to a bus arbitration apparatus that sets a ratio of the number of times of bus right acquisition of bus masters.
2. Description of the Related Art
A bus arbitration apparatus has been used to decide bus-use rights for a plurality of bus masters sharing a bus. Various kinds of priority of bus-use rights for each bus master have been discussed according to uses such as an equal priority for each master and a fixed order of priorities set in advance.
Among bus arbitration apparatuses, there are discussed some bus arbitration apparatuses that can set the ratio of using the bus for each master. Japanese Patent Application Laid-Open No. 10-326253 discusses a bus arbitration apparatus capable of freely setting the ratio of number of times of acquiring bus-use rights by each bus master.
This apparatus controls the number of times of the acquisition of bus-use rights by each master by presetting the number of times of acquiring bus-use rights for each bus master and masking a bus-use request signal to the bus master whose number of times of bus-use rights being granted has reached the preset number of times.
In the conventional bus arbitration apparatus described above, the number of times of actually acquiring bus-use rights is counted by a counter corresponding to the bus master. When the number of times of bus-use rights being actually granted reaches the count preset corresponding to each bus master, the bus arbitration apparatus operates so as not to permit transfer of a bus master to which bus-use rights have been granted. If there is no bus-use request from a bus master whose number of times of bus-use rights being granted has not reached the preset count, the bus arbitration apparatus resets the counter.
The operation of the conventional bus arbitration apparatus will be described referring to FIG. 4. Behavior of a bus arbitration apparatus in a configuration in which there are four bus masters is illustrated in a timing chart in FIG. 4. Regarding the ratio of the number of times for each bus master to acquire bus-use rights, a bus master 0 and a bus master 2 have two times set thereto and the bus master 1 and a bus master 3 have one time set thereto.
Bus-use requests of the bus masters 0, 1, 3 continue to be asserted, and a bus-use request of the bus master 2 is not asserted in T0 to T7 periods and is asserted in T8 and subsequent periods. Use permission counters of each bus master in timing T0 have values preset from outside.
Then, the bus arbitration apparatus selects one bus master from bus masters whose bus-use request is asserted and provides a bus-use permission signal. In the T0 to T3 periods, the bus-use permission is given to the bus master 0, the bus master 1, the bus master 3, and the bus master 0 in this order.
In timing T4, the bus-use permission has been given to the bus masters 0, 1, 3 for the preset number of times of bus-use right acquisition and thus, new bus-use permission is not given to such bus masters as long as the counter is not reset. If a bus-use request is sent from the bus master 2 in timing T4, the bus-use permission is given to the bus master 2, but at this point, there is no bus-use request from the bus master 2.
Here, bus-use request signals after masking are all deasserted and a condition for recounting the number of times of bus-use rights being granted is satisfied and thus, the use permission counter is reset. The resetting of the use permission counter is indicated by a clear signal. The clear signal is asserted in the T4 period.
In the T5 to T7 periods, one-time bus-use permission is given to each of the bus masters 0, 1, 3. In timing T8, the bus-use request of the bus master 2 is asserted.
In T8 to T10 periods, one-time bus-use permission is given to the bus master 1 and two-time bus-use permission is given to the bus master 2.
In timing T11, the bus-use permission has been given to all bus masters for the preset number of times of the bus-use right acquisition and thus, no bus-use permission is granted. Therefore, a judgment is made to reset the use permission counter to accept a new bus-use request and a clear signal is asserted.
In the T0 to T11 periods, as described above, the number of times of the acquisition of bus-use rights of each bus master is four times for the bus master 0, two times for the bus master 1, two times for the bus master 2, and two times for the bus master 3. While the bus master 2 is expected to acquire the bus as many times as the bus master 0, but actually the bus master 2 acquires bus-use rights half as many times as expected.
In a conventional bus arbitration apparatus, as described above, a bus master that cannot output a bus-use request signal when the bus arbitration apparatus is ready to grant bus-use permission may not be able to have bus-use requests granted in the ratio of the preset number of times of bus acquisition.